replace Text With HTML
Replaces a range of a text block with the text and the formatting of HTML, such as the HTML of a paste. HTML from getTextAsHTML sets every property it carries. Its typeface applies only when a typeface of the scene holds its font file. Otherwise the text keeps the typeface at the cursor, with the weight and style of the source. HTML of another app, such as Google Docs, Word, a web page or an Apple app, sets weight, italic and decorations. It also sets the script style, case, colors, font size, letter spacing, line height, lists and alignment. A CSS px is one pixel of a scene whose font size unit is the pixel. The text takes the first font family of the HTML that a typeface of the asset sources has. Without such a typeface, it keeps the typeface at the cursor. A gray, black or white that covers the largest part of the text is the default color of that app. It is not applied, and the same rule applies to the background color. A pasted paragraph without a list keeps the list of the target paragraph. Without the "text/character" scope, only the text is inserted, with the style at the cursor. Without the "fill/change" scope, or when the text color is bound to a variable, no color is pasted. When the font size or the typeface of the block is bound to a variable, it is not pasted. While the block is being edited and no range is given, the selection is replaced and the cursor moves behind the inserted text. Required scope: "text/edit"
Parameters
the text block into which to insert the HTML.
the HTML. Markup that is not supported keeps only its text.
the start index of the range to replace. If the value is negative and the block is being edited, this falls back to the start of the selection. Otherwise it falls back to the start of the entire text.